<template>
  <div>
    <div class="swiper-container" ref="banner">
      <div class="swiper-wrapper">
        <div class="swiper-slide" v-for="(v, i) in bannerList" :key="i">
          <img :src="v" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Swiper from "swiper";
import "swiper/swiper-bundle.css";
import axios from "axios";
export default {
  name: "Banner",
  data() {
    return {
      bannerList: []
    };
  },
  created() {},
  mounted() {
    axios.get("/list").then(resp => {
      this.bannerList = resp.data.data;
      this.$nextTick().then(() => {
        new Swiper(this.$refs.banner);
      });
    });
  }
};
</script>

<style>
</style>